package views;

import com.example.android.google.apis.R;

import docks.Dock;
import docks.DockController;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Pins extends Activity{

	int idstation;
	String address;
	int bikes;
	int free;
	private Button directions,favs,map;
	
	public void onCreate(Bundle icicle) {
		
		super.onCreate(icicle);
		setContentView(R.layout.ppins);
		
		Bundle b = getIntent().getExtras();
		
		idstation = b.getInt("ID");
		DockController dc = DockController.getInstance();
		Dock d = dc.getDock(idstation);

		address = d.getAddress();
		EditText ad = (EditText)findViewById(R.id.pinsaddress);
		ad.setText(address);
		
		bikes = d.getAvailableBikes();
		EditText bi = (EditText)findViewById(R.id.pinsbikes);
		bi.setText(bikes);
		
		free = d.getFreeSlots();
		EditText f = (EditText)findViewById(R.id.pinsslots);
		f.setText(free);
		
		directions = (Button)findViewById(R.id.pinsdir);
		directions.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
		
				//Intent intent = new Intent(PantallaPins.this,MapsDemo.class);
				//startActivity(intent);
			}
			
		});
		
		favs = (Button)findViewById(R.id.pinsfav);
		favs.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
		
				//
				Intent intent = new Intent(Pins.this, views.DockTab.class);
				startActivity(intent);
			}
			
		});
		
		map = (Button)findViewById(R.id.pinsmap);
		map.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
		
				//Intent intent = new Intent(PantallaPins.this, MapsDemo.class);
				//startActivity(intent);
			}
			
		});
	}
}
